Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bowser

Package Overview
Dependencies
Maintainers
1
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bowser

Lightweight browser detector

  • 2.11.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is bowser?

The bowser npm package is a browser detection library. It helps in identifying the browser and rendering engine a user is using, as well as providing information about the browser's capabilities, such as whether it supports touch events or service workers. This can be particularly useful for tailoring user experiences to different environments or for analytics and debugging purposes.

What are bowser's main functionalities?

Browser Detection

Detects the browser name using the user agent string.

const Bowser = require('bowser');
const browser = Bowser.getParser(window.navigator.userAgent);
const browserName = browser.getBrowserName();

Browser Version Detection

Determines the version of the browser being used.

const Bowser = require('bowser');
const browser = Bowser.getParser(window.navigator.userAgent);
const browserVersion = browser.getBrowserVersion();

Platform Detection

Identifies the platform (desktop, mobile, tablet, etc.) on which the browser is running.

const Bowser = require('bowser');
const browser = Bowser.getParser(window.navigator.userAgent);
const platformType = browser.getPlatformType();

Feature Checks

Checks if the browser supports certain features, such as touch events.

const Bowser = require('bowser');
const browser = Bowser.getParser(window.navigator.userAgent);
const supportsTouch = browser.satisfies({
  'mobile': { 'touch': true }
});

OS Detection

Determines the operating system on which the browser is running.

const Bowser = require('bowser');
const browser = Bowser.getParser(window.navigator.userAgent);
const osName = browser.getOSName();

Other packages similar to bowser

Keywords

FAQs

Package last updated on 12 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc